import { createApp } from "vue";
import "./style.css";
import App from "./App.vue";
import * as echarts from 'echarts';
// 1. 创建路由器实例
import { createRouter, createWebHistory } from "vue-router";
// 2.配置路径与页面组件的映射关系
import weather from "./views/weather.vue";
import weather30 from "./views/weather30.vue";
import rainfall from "./views/rainfall.vue";
import lifeIndex from "./views/lifeIndex.vue";
import airQuality from "./views/airQuality.vue";
import disasterWarning from "./views/disasterWarning.vue";
import historicalData from "./views/historicalData.vue";



var router = createRouter({
  routes: [
    { path: "/weather", name: "天气", component: weather },
    { path: "/weather30", name: "30天预报", component: weather30 },
    { path: "/rainfall", name: "降水", component: rainfall },
    { path: "/air-quality", name: "空气质量", component: airQuality },
    { path: "/disaster-warning", name: "灾害预警", component: disasterWarning },
    { path: "/life-index", name: "生活指数", component: lifeIndex },
    { path: "/historical-data", name: "历史数据", component: historicalData },
  ],
  history: createWebHistory(),
});
// 3.将路由器实例注册为vue的插件
createApp(App).use(router).mount("#app");
window.ECharts = echarts;

// 4.将vue-router提供的全局组件RouterView 插入到App.vue中
